package com.javasoft.controller.XGX;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.javasoft.entity.XGX.Practice;
import com.javasoft.service.XGX.impl.PracticeImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/Practice")

public class PracticeController {

    @Autowired
    private PracticeImpl practice_impl;

    @GetMapping("/getPractice")
    public Page<Practice> getPractice(
            @RequestParam(value = "subject",required = false) String subject,
            @RequestParam(value = "knoPoint",required = false) String knoPoint,
            @RequestParam(value = "type",required = false) String type,
            @RequestParam(value = "difRank",required = false, defaultValue = "-1") Integer difRank,
            @RequestParam(value = "num",required = false, defaultValue = "10") Integer num,
            @RequestParam(defaultValue = "1",value = "currentPage") Integer currentPage,
            @RequestParam(defaultValue = "15",value = "pageSize") Integer pageSize
    ){
        return practice_impl.getPracticePage(subject, knoPoint, type, difRank, num, currentPage, pageSize);
    }
}
